﻿<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title>{:config('APP_TITLE_SNAME')}</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="/static/layui/layuiadmin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="/static/layui/layuiadmin/style/admin.css" media="all">
    <style>
    .layui-side-menu .layui-nav .layui-nav-item > a {
        padding-top: 0;
        padding-bottom: 0;
    }
    
    .layadmin-side-shrink .layui-layout-admin .layui-logo {
        background-size: 60% 70%;
    }
    
    .span-logo {
        background-image: url('/static/layui/layuiadmin/style/res/logo.png');
        background-size: 50% 50%;
    }
    
    .layui-layout-admin .layui-header .layui-nav .layui-nav-item,
    .layui-layout-admin .layui-logo {
        line-height: 45px;
    }
    
    /*.layadmin-pagetabs {
        top: 90px;
    }*/
    
    .layui-layout-admin .layui-body {
        top: 130px;
    }
    
    #flutter_screen {
        position: fixed;
        top: 90px;
        right: 0;
        height: 40px;
        width: 100%;
        margin: 0 auto;
        white-space:nowrap;
        overflow: hidden;
        background: #fff;
        border-top: 0.5px solid #ccc;
    }
    #flutter_screen p{
    }
    </style>
</head>

<body class="layui-layout-body">
    <div id="LAY_app">
        <div class="layui-layout layui-layout-admin">
            <div class="layui-header">
                <!-- 头部区域 -->
                <ul class="layui-nav layui-layout-left">
                    <li class="layui-nav-item layadmin-flexible" lay-unselect>
                        <a href="javascript:;" layadmin-event="flexible" title="侧边伸缩">
                            <i class="layui-icon layui-icon-shrink-right" id="LAY_app_flexible"></i>
                        </a>
                    </li>
                    <li class="layui-nav-item" lay-unselect>
                        <a href="javascript:;" layadmin-event="refresh" title="刷新">
                            <i class="layui-icon layui-icon-refresh-3"></i>
                        </a>
                    </li>
                    <!-- <li class="layui-nav-item layui-hide-xs" lay-unselect>
            <input type="text" placeholder="搜索..." autocomplete="off" class="layui-input layui-input-search" layadmin-event="serach" lay-action="template/search.html?keywords=">
          </li> -->
                </ul>
                <ul class="layui-nav layui-layout-right" lay-filter="layadmin-layout-right">
                    <!-- <li class="layui-nav-item layui-hide-xs" lay-unselect>
            <a href="javascript:;" layadmin-event="theme">
              <i class="layui-icon layui-icon-theme"></i>
        
            </a>
          </li> -->
                    <li class="layui-nav-item layui-hide-xs" lay-unselect>
                        <a href="javascript:;" layadmin-event="fullscreen">
                            <i class="layui-icon layui-icon-screen-full"></i>
                        </a>
                    </li>
                    <li class="layui-nav-item layui-hide-xs" lay-unselect>
                        <a href="javascript:;" layadmin-event="">
                            <cite>{$usershow|raw}</cite>
                        </a>
                    </li>
                    <li class="layui-nav-item" lay-unselect>
                        <a href="javascript:;">
                            <cite>{:session('username')}</cite>
                        </a>
                        <dl class="layui-nav-child">
                            <dd class=" layui-hide-sm"><a href="javascript:;"><small id="dianyue"></small></a></dd>
                            <dd><a lay-href="{:url("admin/index/changePwd")}">修改密码</a></dd>
                            <hr>
                            <dd style="text-align: center;"><a href="{:url("Login/loginOut")}">退出</a></dd>
                        </dl>
                    </li>
                    <li class="layui-nav-item layui-hide-xs" lay-unselect>
                        <a href="javascript:;" layadmin-event=""><i class="layui-icon layui-icon-more-vertical"></i></a>
                    </li>
                    <li class="layui-nav-item layui-show-xs-inline-block layui-hide-sm" lay-unselect>
                        <a href="javascript:;" layadmin-event=""><i class="layui-icon layui-icon-more-vertical"></i></a>
                    </li>
                </ul>
            </div>
            <!-- 侧边菜单 -->
            <div class="layui-side layui-side-menu">
                <div class="layui-side-scroll">
                    <div class="layui-logo" lay-href="{:url('index/welcome')}">
                        <span>
                <span style="position: relative;"><img style="position: absolute;left: -55px;top: -11px;" style="display: inline-block;line-height: 50x;" src="/static/layui/layuiadmin/style/res/logo.png" alt="" width="50" height="50"></span>
                        <span style="position: relative;"><span>{:config('APP_SNAME')}</span><small style="position: absolute;left: 0;top: 0;"><small>v2.0</small></small>
                        </span>
                        <!-- <span style="line-height: 20px;height: 50px;display: inline-block;"><p style=""> ZLSMS</p><small>v2.0</small></span>
                </span> -->
                    </div>
                    <ul class="layui-nav layui-nav-tree" lay-shrink="all" id="LAY-system-side-menu" lay-filter="layadmin-system-side-menu">
                        <li data-name="home" class="layui-nav-item layui-nav-itemed">
                            <a href="javascript:;" lay-tips="主页" lay-direction="2">
                                <i class="layui-icon layui-icon-home"></i>
                                <cite>主页</cite>
                            </a>
                            <dl class="layui-nav-child">
                                <dd data-name="console" class="layui-this">
                                    <a lay-href="{:url('index/welcome')}">控制台</a>
                                </dd>
                            </dl>
                        </li>
                        {volist name="menu" id="auth"}
                        <li data-name="{$auth.auth_name}" class="layui-nav-item">
                            <a href="javascript:;" lay-tips="{$auth.auth_name}" lay-direction="2">
                                <i class="layui-icon {$auth.menu_icon}"></i>
                                <cite>{$auth.auth_name}</cite>
                            </a>
                            <dl class="layui-nav-child">
                                {if(!empty($auth['sub']))}
                                {volist name="$auth['sub']" id="data"}
                                <dd data-name="{$data['auth_c_a']}" class="ls-{$data['auth_id']}">
                                    <a lay-href="{:url('admin/'.$data['auth_c_a'])}">{$data['auth_name']}</a>
                                </dd>
                                {/volist}
                                {/if}
                            </dl>
                        </li>
                        {/volist}
                    </ul>
                </div>
            </div>
            <!-- 页面标签 -->
            <div class="layadmin-pagetabs" id="LAY_app_tabs">
                <div id="flutter_screen"></div>
                <div class="layui-icon layadmin-tabs-control layui-icon-prev" layadmin-event="leftPage"></div>
                <div class="layui-icon layadmin-tabs-control layui-icon-next" layadmin-event="rightPage"></div>
                <div class="layui-icon layadmin-tabs-control layui-icon-down">
                    <ul class="layui-nav layadmin-tabs-select" lay-filter="layadmin-pagetabs-nav">
                        <li class="layui-nav-item" lay-unselect>
                            <a href="javascript:;"></a>
                            <dl class="layui-nav-child layui-anim-fadein">
                                <dd layadmin-event="closeThisTabs"><a href="javascript:;">关闭当前标签页</a></dd>
                                <dd layadmin-event="closeOtherTabs"><a href="javascript:;">关闭其它标签页</a></dd>
                                <dd layadmin-event="closeAllTabs"><a href="javascript:;">关闭全部标签页</a></dd>
                            </dl>
                        </li>
                    </ul>
                </div>
                <div class="layui-tab" lay-unauto lay-allowClose="true" lay-filter="layadmin-layout-tabs">
                    <ul class="layui-tab-title" id="LAY_app_tabsheader">
                        <li lay-id="{:url('index/welcome')}" lay-attr="{:url('index/welcome')}" class="layui-this"><i class="layui-icon layui-icon-home"></i></li>
                    </ul>
                </div>
            </div>
            <!-- 主体内容 -->
            <div class="layui-body" id="LAY_app_body">
                <div class="layadmin-tabsbody-item layui-show">
                    <iframe src="{:url('index/welcome')}" frameborder="0" class="layadmin-iframe"></iframe>
                </div>
            </div>
            <!-- 辅助元素，一般用于移动设备下遮罩 -->
            <div class="layadmin-body-shade" layadmin-event="shade"></div>
        </div>
    </div>
    <script src="/static/layui/lyadmin/jquery-3.3.1.min.js"></script>
    <script src="/static/layui/layuiadmin/layui/layui.js"></script>
    <script>
    var element;
    layui.use(['element', 'layer'], function() {

        element = layui.element;

    });

    var orderclick = 0;

    function clickShuaxin(e) {
        {if (in_array(session('channel_level'), [3, 5]) && session('user_type') == 'channel') }

            if (e.html() == '发送查询') {
                if (orderclick > 0) {
                    setTimeout(function() {
                        var iframe = $('#LAY_app_body').find('.layui-show').find('iframe');
                        $(iframe).attr('src', $(iframe).attr('src'));
                    }, 300);
                }
                orderclick++;
            } 

        {/if} 

    }

    function tabAdd(ls) {

        // $("dd[data-name=SendNote/index]").click()
        $("." + ls + " a").click();
        // element.tabAdd('layadmin-layout-tabs', {
        //   title: title
        //   ,content: '<iframe src="'+content+'" frameborder="0" class="layadmin-iframe"></iframe>' //支持传入html
        //   ,id: layid
        // });

        // element.tabChange('layadmin-layout-tabs', layid);
    }
    layui.config({
        base: '/static/layui/layuiadmin/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use('index');

function IsPC() {
    var userAgentInfo = navigator.userAgent;
    var Agents = ["Android", "iPhone",
                "SymbianOS", "Windows Phone",
                "iPad", "iPod"];
    var flag = true;
    for (var v = 0; v < Agents.length; v++) {
        if (userAgentInfo.indexOf(Agents[v]) > 0) {
            flag = false;
            break;
        }
    }
    return flag;
}
  
    /**自定义公共方法*/
    $(function() {
        if(IsPC()){
           $('#flutter_screen').css('width',$('#flutter_screen').width()-$('.layui-side-menu').outerWidth(true)+'px'); 
        }

        gsr = goneScreen('#flutter_screen',{content:[],seep:7,isLoop:true,end: function(config){
        }});
        gsr.flutter_screen_info()



        {if condition = "session('user_type') == 'admin'"}
        
        getapplycount_fun2()

        {/if}

        // $.ajax({
        //     url: "{:url('index/getapplycount_com')}?tp=2",
        //     type: 'GET',
        //     dataType: 'json',
        //     error: function() {}, //错误执行方法
        //     success: function(data) {
        //         if(data.code == 200){
        //             gsr.reload({'content':data.msg});
        //             // gsr.flutter_screen_info()
        //         }
        //         //开始飘
        //         gsr.flutter_screen_info();
        //     } //成功执行方法
        // });
        

        {if condition = "session('user_type') != 'admin'"}
            getapplycount_fun();
            setInterval("getapplycount_fun()", 60000); 
        {/if}
    });

    //飘屏
    var gsr;

    /*查询未审核的数据*/
    function getapplycount_fun2() {
        $.ajax({
            url: "{:url('index/getapplycount_com')}?tp=2",
            type: 'GET',
            dataType: 'json',
            error: function() {}, //错误执行方法
            success: function(data) {
                // callback(data);
                if(data.code == 200){
                    gsr.reload({'content':data.msg});
                }
                // gsr.flutter_screen_info()
            }, //成功执行方法
            complete:function(){
                setTimeout(function(){
                    getapplycount_fun2();
                },30000)
            }
        });
    }

    /*查询未审核的数据*/
    function getapplycount_fun() {
        $.ajax({
            url: "../index/getapplycount_com",
            type: 'GET',
            dataType: 'json',
            error: function() {}, //错误执行方法
            success: function(data) {
                if (data) {
                    var signs = 0;
                    var notes = 0;
                    var txtul = '';
                    //检查是否有签名待审核
                    if (data.signs) {
                        signs = data.signs;
                        txtul += "<li><a href='/admin/Sign/index.html?status=2'>签名审核 (" + signs + ")</a></li>";
                    }
                    //检查是否有短信待审核
                    if (data.notes) {
                        notes = data.notes;
                        txtul += "<li><a href='/admin/mmstemplate/index.html?status=2'>短信审核 (" + notes + ")</a></li>";
                    }

                    var allmsg = signs + notes;

                    if (allmsg > 0) {
                        $("#msgcount").text(allmsg);
                        $("#msgcountul").html(txtul);
                    }
                    //检查余额
                    if (data.sms_balance >= 0) {
                        var balance = "余额：" + data.sms_balance + " 条";
                        $("#duanxinyue").html(balance);
                        $("#dianyue").html(balance);
                    }

                }
            } //成功执行方法
        });
    }

    //emt：元素
    //seep：时间
    function goneScreen(emt,config){

        let gs = new Object();

        //初始参数
        gs.flutter_array = config.content ? config.content : [];//数组，飘屏文字
        gs.emt           = emt;//窗口元素
        gs.seep          = config.seep ? config.seep : 5;//速度
        gs.isLoop        = config.isLoop;//是否循环
        gs.end = function(){
            if(config.end){
                config.end()
            }
        }

        //内置参数
        gs.bodywidth = 0;
        gs.screenwidth = 0;
        gs.flutter_array_index = 0;//叠加数

        //配置
        gs.config = config;
        //重载
        gs.reload = function(config,load){
            //设置内容
            if(config.content){
                if(gs.flutter_array.length <= 0){
                    gs.flutter_array = config.content ? config.content : [];//数组，飘屏文字
                    gs.flutter_screen_info();
                }else{
                    gs.flutter_array = config.content ? config.content : [];//数组，飘屏文字
                }
                
            }
            //设置
            if(config.isLoop){
                gs.isLoop = config.isLoop;
            }
            //设置速度
            if(config.seep){
                gs.seep = config.seep ? config.seep : 5;//速度
            }
            //重新循环
            if(load){
                gs.flutter_array_index = -1;
            }
        }


        //初始化飘屏
        gs.flutter_screen_info = function(){

            let index = gs.flutter_array_index;

            if(gs.flutter_array[index]){
                $(gs.emt).find('p').fadeIn("slow");
                $(gs.emt).html('<p style="position: absolute; left: 100%; top: 0; height: 40px; line-height: 40px; padding-left: 15px;">'+gs.flutter_array[index]+'</p>');

                gs.bodywidth = $(gs.emt).width();//窗口宽度

                gs.screenwidth = $(gs.emt).find('p')[0].scrollWidth+25;//飘文字长度
                
                //每条循环
                gs.flutter_screen_go()

            }
            else{
                gs.end();
                
                if(gs.flutter_array.length <= 0 || gs.flutter_array[index] == ''){
                    return false;
                }
                //整体循环
                gs.flutter_array_index = 0;

                if(gs.isLoop){
                    console.log('循环模式')
                    gs.flutter_screen_info();
                }
                
            }
        }

        //动作
        gs.flutter_screen_go = function(){
            let screen = gs.screenwidth;

            //计算时间
            let screen_s = gs.screenwidth/(gs.seep*10)*1000;
            // console.log('用时',screen_s/1000,'秒')

            //最少时间
            let screen_s_min = (gs.bodywidth/(gs.seep*10))*1000;

            if( screen_s < screen_s_min ){
                screen_s = screen_s_min;
            }

            // console.log('最后用时',screen_s/1000,'秒')
            $(gs.emt).find('p').animate({left:'-'+(screen)+'px'},screen_s,'linear',function(){

                gs.flutter_array_index++;

                gs.flutter_screen_info()
                
            });
        }

        return gs;
    }
    </script>
</body>

</html>
